package com.czxy.Service;

import com.czxy.dao.DownLoadMapper;
import com.czxy.domain.DownLoad;
import com.czxy.utils.MyBatisUtils;

import java.util.List;

public class DownLoadService {
    public List<DownLoad> findAllVideo(){
        DownLoadMapper mapper = MyBatisUtils.getMapper(DownLoadMapper.class);
        List<DownLoad> allVideo = mapper.findAllVideo();
        MyBatisUtils.close();
        return allVideo;
    }

    public String findVideoAddress(String videoId) {
        DownLoadMapper mapper = MyBatisUtils.getMapper(DownLoadMapper.class);
        String videoAddressById = mapper.findVideoAddressById(videoId);
        MyBatisUtils.close();
        return videoAddressById;
    }

    public List<DownLoad> findAllVideo02() {
        DownLoadMapper mapper = MyBatisUtils.getMapper(DownLoadMapper.class);
        List<DownLoad> allVideo = mapper.findAllVideo02();
        MyBatisUtils.close();
        return allVideo;
    }
}
